package com.hello.system.domain;

import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.hello.common.core.annotation.Excel;
import com.hello.common.core.web.domain.BaseEntity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.IdType;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 支付订单记录对象 payment_orders
 * 
 * @author hello
 * @date 2025-10-29
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class PaymentOrders extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 订单ID（主键，唯一订单号） */
    private String orderId;

    /** 用户ID（关联users表） */
    @Excel(name = "用户ID", readConverterExp = "关=联users表")
    private Long userId;

    /** 支付金额（单位：元） */
    @Excel(name = "支付金额", readConverterExp = "单=位：元")
    private BigDecimal amount;

    /** 购买积分数量 */
    @Excel(name = "购买积分数量")
    private Long points;

    /** 订单标题 */
    @Excel(name = "订单标题")
    private String orderTitle;

    /** 订单描述 */
    @Excel(name = "订单描述")
    private String orderDescription;

    /** 支付平台（alipay、wechat、apple等） */
    @Excel(name = "支付平台", readConverterExp = "a=lipay、wechat、apple等")
    private String paymentPlatform;

    /** 支付宝交易号 */
    @Excel(name = "支付宝交易号")
    private String alipayTradeNo;

    /** 支付宝应用ID */
    @Excel(name = "支付宝应用ID")
    private String alipayAppId;

    /** 支付宝商户订单号 */
    @Excel(name = "支付宝商户订单号")
    private String alipayOutTradeNo;

    /** 支付状态（0-待支付，1-支付中，2-支付成功，3-支付失败，4-已关闭，5-已退款） */
    @Excel(name = "支付状态", readConverterExp = "0=-待支付，1-支付中，2-支付成功，3-支付失败，4-已关闭，5-已退款")
    private Integer paymentStatus;

    /** 支付平台回调通知数据（JSON格式） */
    @Excel(name = "支付平台回调通知数据", readConverterExp = "J=SON格式")
    private String notifyData;

    /** 支付平台回调通知时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "支付平台回调通知时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date notifyTime;

    /** 客户端IP地址 */
    @Excel(name = "客户端IP地址")
    private String clientIp;

    /** 客户端User-Agent */
    @Excel(name = "客户端User-Agent")
    private String userAgent;

    /** 订单过期时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "订单过期时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date expireTime;

    /** 支付完成时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "支付完成时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date paymentTime;

    /** 退款时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "退款时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date refundTime;

    /** 退款金额（单位：元） */
    @Excel(name = "退款金额", readConverterExp = "单=位：元")
    private BigDecimal refundAmount;

    /** 退款原因 */
    @Excel(name = "退款原因")
    private String refundReason;

    /** 操作员（退款等操作的管理员） */
    @Excel(name = "操作员", readConverterExp = "退=款等操作的管理员")
    private String operator;

    /** 额外扩展数据（JSON格式） */
    @Excel(name = "额外扩展数据", readConverterExp = "J=SON格式")
    private String extraData;

    /** 订单创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "订单创建时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date createdAt;

    /** 更新时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date updatedAt;

    public void setOrderId(String orderId) 
    {
        this.orderId = orderId;
    }

    public String getOrderId() 
    {
        return orderId;
    }
    public void setUserId(Long userId) 
    {
        this.userId = userId;
    }

    public Long getUserId() 
    {
        return userId;
    }
    public void setAmount(BigDecimal amount) 
    {
        this.amount = amount;
    }

    public BigDecimal getAmount() 
    {
        return amount;
    }
    public void setPoints(Long points) 
    {
        this.points = points;
    }

    public Long getPoints() 
    {
        return points;
    }
    public void setOrderTitle(String orderTitle) 
    {
        this.orderTitle = orderTitle;
    }

    public String getOrderTitle() 
    {
        return orderTitle;
    }
    public void setOrderDescription(String orderDescription) 
    {
        this.orderDescription = orderDescription;
    }

    public String getOrderDescription() 
    {
        return orderDescription;
    }
    public void setPaymentPlatform(String paymentPlatform) 
    {
        this.paymentPlatform = paymentPlatform;
    }

    public String getPaymentPlatform() 
    {
        return paymentPlatform;
    }
    public void setAlipayTradeNo(String alipayTradeNo) 
    {
        this.alipayTradeNo = alipayTradeNo;
    }

    public String getAlipayTradeNo() 
    {
        return alipayTradeNo;
    }
    public void setAlipayAppId(String alipayAppId) 
    {
        this.alipayAppId = alipayAppId;
    }

    public String getAlipayAppId() 
    {
        return alipayAppId;
    }
    public void setAlipayOutTradeNo(String alipayOutTradeNo) 
    {
        this.alipayOutTradeNo = alipayOutTradeNo;
    }

    public String getAlipayOutTradeNo() 
    {
        return alipayOutTradeNo;
    }
    public void setPaymentStatus(Integer paymentStatus) 
    {
        this.paymentStatus = paymentStatus;
    }

    public Integer getPaymentStatus() 
    {
        return paymentStatus;
    }
    public void setNotifyData(String notifyData) 
    {
        this.notifyData = notifyData;
    }

    public String getNotifyData() 
    {
        return notifyData;
    }
    public void setNotifyTime(Date notifyTime) 
    {
        this.notifyTime = notifyTime;
    }

    public Date getNotifyTime() 
    {
        return notifyTime;
    }
    public void setClientIp(String clientIp) 
    {
        this.clientIp = clientIp;
    }

    public String getClientIp() 
    {
        return clientIp;
    }
    public void setUserAgent(String userAgent) 
    {
        this.userAgent = userAgent;
    }

    public String getUserAgent() 
    {
        return userAgent;
    }
    public void setExpireTime(Date expireTime) 
    {
        this.expireTime = expireTime;
    }

    public Date getExpireTime() 
    {
        return expireTime;
    }
    public void setPaymentTime(Date paymentTime) 
    {
        this.paymentTime = paymentTime;
    }

    public Date getPaymentTime() 
    {
        return paymentTime;
    }
    public void setRefundTime(Date refundTime) 
    {
        this.refundTime = refundTime;
    }

    public Date getRefundTime() 
    {
        return refundTime;
    }
    public void setRefundAmount(BigDecimal refundAmount) 
    {
        this.refundAmount = refundAmount;
    }

    public BigDecimal getRefundAmount() 
    {
        return refundAmount;
    }
    public void setRefundReason(String refundReason) 
    {
        this.refundReason = refundReason;
    }

    public String getRefundReason() 
    {
        return refundReason;
    }
    public void setOperator(String operator) 
    {
        this.operator = operator;
    }

    public String getOperator() 
    {
        return operator;
    }
    public void setExtraData(String extraData) 
    {
        this.extraData = extraData;
    }

    public String getExtraData() 
    {
        return extraData;
    }
    public void setCreatedAt(Date createdAt) 
    {
        this.createdAt = createdAt;
    }

    public Date getCreatedAt() 
    {
        return createdAt;
    }
    public void setUpdatedAt(Date updatedAt) 
    {
        this.updatedAt = updatedAt;
    }

    public Date getUpdatedAt() 
    {
        return updatedAt;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("orderId", getOrderId())
            .append("userId", getUserId())
            .append("amount", getAmount())
            .append("points", getPoints())
            .append("orderTitle", getOrderTitle())
            .append("orderDescription", getOrderDescription())
            .append("paymentPlatform", getPaymentPlatform())
            .append("alipayTradeNo", getAlipayTradeNo())
            .append("alipayAppId", getAlipayAppId())
            .append("alipayOutTradeNo", getAlipayOutTradeNo())
            .append("paymentStatus", getPaymentStatus())
            .append("notifyData", getNotifyData())
            .append("notifyTime", getNotifyTime())
            .append("clientIp", getClientIp())
            .append("userAgent", getUserAgent())
            .append("expireTime", getExpireTime())
            .append("paymentTime", getPaymentTime())
            .append("refundTime", getRefundTime())
            .append("refundAmount", getRefundAmount())
            .append("refundReason", getRefundReason())
            .append("operator", getOperator())
            .append("extraData", getExtraData())
            .append("createdAt", getCreatedAt())
            .append("updatedAt", getUpdatedAt())
            .toString();
    }
}
